package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.check.fireequipment;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.check.fireequipment.FireEquipmentService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 消防器材控制器
 */
@Action
@RequestMapping(value="check/fireEquipment")
public class FireEquipmentController extends BaseController {
    @Resource
    public FireEquipmentService fireEquipmentService;

    /**
     * 消防器材列表
     * @param
     * page	第几页
     * limit	每页多少条
     * businessId	单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * fireEquipmentTypeId	消防器材类型id
     * @return
     */
    @At(value = "fireEquipmentListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity fireEquipmentListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return fireEquipmentService.fireEquipmentListPage(jsonParam);
    }

    /**
     * 消防器材详情
     * @param  id	消防器材的id
     * @return
     */
    @At(value = "fireEquipmentDetail", method = RequestMethod.GET, param = { "id"})
    public RespEntity fireEquipmentDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return fireEquipmentService.fireEquipmentDetail(jsonParam);
    }

    /**
     * 消防器材新增
     * @param
     * fireEquipmentTypeId	消防器材类型id
     * num	数量
     * spec	规格
     * @return
     */
    @At(value = "fireEquipmentAdd", method = RequestMethod.POST, param = { "fireEquipmentTypeId","num" })
    public RespEntity fireEquipmentAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return fireEquipmentService.fireEquipmentAdd(jsonParam);
    }

    /**
     * 消防器材修改
     * @param
     * fireEquipmentTypeId	消防器材类型id
     * num	数量
     * spec	规格
     * id	消防器材id
     * @return
     */
    @At(value = "fireEquipmentUpdate", method = RequestMethod.POST, param = { "fireEquipmentTypeId","num","id" })
    public RespEntity fireEquipmentUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return fireEquipmentService.fireEquipmentUpdate(jsonParam);
    }

    /**
     * 消防器材删除
     * @param   id	消防器材的id
     * @return
     */
    @At(value = "fireEquipmentDelete", method = RequestMethod.POST, param = { "id" })
    public RespEntity fireEquipmentDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return fireEquipmentService.fireEquipmentDelete(jsonParam);
    }

    /**
     * 消防器材类型列表
     * @param
     * @return
     */
    @At(value = "fireEquipmentTypeList", method = RequestMethod.GET)
    public RespEntity fireEquipmentTypeList(@RequestBody(required = false) JSONObject jsonParam) {
        return fireEquipmentService.fireEquipmentTypeList(jsonParam);
    }






   
}